package com.ruoyi.video.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.video.domain.PlaySeasonTaskVideo;
import com.ruoyi.video.mapper.PlaySeasonTaskVideoMapper;
import com.ruoyi.video.service.IPlaySeasonTaskVideoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 任务视频Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonTaskVideoServiceImpl extends ServiceImpl<PlaySeasonTaskVideoMapper,PlaySeasonTaskVideo> implements IPlaySeasonTaskVideoService
{
    @Resource
    private PlaySeasonTaskVideoMapper playSeasonTaskVideoMapper;

    /**
     * 查询任务视频
     *
     * @param id 任务视频主键
     * @return 任务视频
     */
    @Override
    public PlaySeasonTaskVideo selectPlaySeasonTaskVideoById(String id)
    {
        return playSeasonTaskVideoMapper.selectPlaySeasonTaskVideoById(id);
    }

    /**
     * 查询任务视频列表
     *
     * @param playSeasonTaskVideo 任务视频
     * @return 任务视频
     */
    @Override
    public List<PlaySeasonTaskVideo> selectPlaySeasonTaskVideoList(PlaySeasonTaskVideo playSeasonTaskVideo)
    {
        return playSeasonTaskVideoMapper.selectPlaySeasonTaskVideoList(playSeasonTaskVideo);
    }

    /**
     * 新增任务视频
     *
     * @param playSeasonTaskVideo 任务视频
     * @return 结果
     */
    @Override
    public int insertPlaySeasonTaskVideo(PlaySeasonTaskVideo playSeasonTaskVideo)
    {
        playSeasonTaskVideo.setCreateTime(DateUtils.getNowDate());
        return playSeasonTaskVideoMapper.insertPlaySeasonTaskVideo(playSeasonTaskVideo);
    }

    /**
     * 修改任务视频
     *
     * @param playSeasonTaskVideo 任务视频
     * @return 结果
     */
    @Override
    public int updatePlaySeasonTaskVideo(PlaySeasonTaskVideo playSeasonTaskVideo)
    {
        return playSeasonTaskVideoMapper.updatePlaySeasonTaskVideo(playSeasonTaskVideo);
    }

    /**
     * 批量删除任务视频
     *
     * @param ids 需要删除的任务视频主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonTaskVideoByIds(String[] ids)
    {
        return playSeasonTaskVideoMapper.deletePlaySeasonTaskVideoByIds(ids);
    }

    /**
     * 删除任务视频信息
     *
     * @param id 任务视频主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonTaskVideoById(String id)
    {
        return playSeasonTaskVideoMapper.deletePlaySeasonTaskVideoById(id);
    }

    /**获取视频数量*/
    @Override
    public Integer selectVideoCount(String playSeasonId) {
        return baseMapper.selectVideoCount(playSeasonId);
    }

    /**获取指定条数数据*/
    @Override
    public PlaySeasonTaskVideo selectVideoInfo(int randomNum,String playSeasonId) {
        return baseMapper.selectVideoInfo(randomNum,playSeasonId);

    }
}
